import 'reflect-metadata';


class Engine{
    start(){
        console.log('发动机启动')
    }
}
class Car{
    constructor(private engine:Engine){
    }
    drive(){
        this.engine.start();
        console.log('开车')
    }
}

// 定义一个依赖注入容器类
class DIContainer{
    // 定义一个存储所有服务的Map对象
    private services = new Map<string,any>();
    register<T>(name:string,Service:new (...args:any[])=>T){
    
    }
    resolve(){

    }
}

// 创建一个依赖注入容器的实例
const containere = new DIContainer();
containere.register('Engine',Engine);
containere.register('Car',Car);